<div id="view-panel" class="rel" style="width:1058px; height:588px; margin-left:30px;">
<?php
$i = 0;
foreach ($data as $p): ?>
  <div class="wallpaper">
<?php
    $prefix = ($p['Wallpaper']['format'] == 'P') ? '800_' : 'iphone_';
    $title  = ($p['Wallpaper']['format'] == 'P') ? 'PC Wallpaper' : 'iPhone Wallpaper';
?>
    <a href="<?php e($this->base); ?>/img/wallpapers/<?php e($prefix.$p['Wallpaper']['filename']); ?>" rel="sexylightbox[group1]" title="<?php e($title); ?>">
      <div style="height:153px; background:url(<?php e($this->base); ?>/img/wallpapers/<?php e($p['Wallpaper']['filename']); ?>) center center no-repeat;"></div>
    </a>
    <div style="text-align:center; color:#58595B;">
      <div style="margin-top:5px;">
<?php if ($p['Wallpaper']['format'] == 'P') { ?>
        <div class="fLeft" style="width:90px; text-align:center;"><a href="<?php e($this->base); ?>/wallpapers/download/800/<?php e($p['Wallpaper']['filename']); ?>">800 x 600</a></div>
        <div class="fLeft" style="width:90px; text-align:center;"><a href="<?php e($this->base); ?>/wallpapers/download/1280/<?php e($p['Wallpaper']['filename']); ?>">1280 x 1024</a></div>
<?php } else { ?>
        <div style="text-align:center;"><a href="<?php e($this->base); ?>/wallpapers/download/iphone/<?php e($p['Wallpaper']['filename']); ?>">iPhone</a></div>
<?php } ?>
        <div class="clear"></div>
      </div>
    </div>
  </div>
<?php endforeach; ?>
  <div class="clear"></div>
  <div id="goprev" class="abs navPrev"><?php echo $paginator->prev(__('PREVIOUS PAGE', true), array(), null, array('class'=>'hide')); ?></div>
  <div id="gonext" class="abs navNext"><?php echo $paginator->next(__('NEXT PAGE', true), array(), null, array('class'=>'hide')); ?></div>
</div>

<script type="text/javascript">
var _webroot = '<?php e($this->base); ?>';

function init () {
    SexyLightbox.initialize({
        color: 'white',
        dir: _webroot+'/css/sexylightbox/',
        OverlayStyles : {
            'background-color': '#000',
            'opacity': 0.5
        }
    });
} // init
<?php $this->addScript('Ext.onReady(function() { init(); });'); ?>
</script>